import java.util.Scanner;

/**
 * @author HW
 */
/*求N阶乘和*/
public class ClassTest {
    public static int facNum(int num){
        int sum=0;
        int j=0;
        for(j=1;j<=num;j++){
            int ret=fac(j);
            sum+=ret;
        }
        return sum;
    }
/*    求N的阶乘*/
    public static int fac(int n){
        int ret=1;
        int i=0;
        for(i=1;i<=n;i++){
            ret*=i;
        }
         return ret;
    }

    public static void main(String[] args) {
        int n;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        System.out.println(facNum(n));

    }
}
